<% title "SQL Import" %>

<%= form_tag :sql_start_import, multipart: true do %>
  <h3>Import SQL File</h3>

  <div class="large-11">
    <label>
      File
      <%= file_field_tag :file %>
    </label>
  </div>

  <div class="large-11">
    <p><span class="radius secondary label">* <%= RailsDb::Adapters::BaseAdapter::MULTI_STATEMENT_HELP_TEXT %></span></p>
    <%= submit_tag raw("&rarr; Import"), class: 'button small' %>
    &nbsp;
    &mdash;
    &nbsp;
    <a href="#" data-reveal-id="sample_modal" id='sample_modal_link'><%= fa_icon('bars') %> Sample</a></span>
    <%= render 'import_sample' %>
  </div>

  <% if @importer && @importer.result.ok? %>
    <div class="large-11">
      <h4>Results</h4>
      <p>
        <span class="radius success label">File was successfully imported</span>
        <span class="radius info label">Time: <%= @importer.time %> seconds</span>
      </p>
    </div>
  <% end %>

<% end %>